from bs4 import BeautifulSoup

html="""
<div class="star">
    <span class="rating45-t"></span>
    <span class="rating_num" property="v:average">case1</span>
    <span class="rating_num" property="v:average">case2</span>
    <span class="rating_num" property="v:average">case3</span>
    <span class="rating_num" property="v:average">case4</span>
    <span property="v:best" content="10.0"></span>
    <span>1306472人评价</span>
</div>
"""
soup=BeautifulSoup(html,'html.parser')
print(soup.find('span',class_='rating_num').string) #获取到文本内容
print(soup.find('span',attrs={'property':'v:average'}).text) #获取到文本内定
print(soup.find('span',attrs={'property':'v:best'}).text) #获取到文本内定
print(soup.find('span',class_='rating_num').get('property')) #获取到属性值

# ll=soup.find_all('span',attrs={'class':"rating_num"})
# for  i in ll:
#     print(i.text)